package com.bestom.waterquality.entity;

import android.annotation.SuppressLint;
import android.os.Build;

import com.bestom.waterquality.R;
import com.bestom.waterquality.WaterQualityApplication;

/**
 * @author shulman
 */
public final class Constant {

    public static final String deviceVersion = Build.VERSION.RELEASE;
    public static final String deviceInfo = "浙江创韵环境科技有限公司";
    public static final String deviceName = "C002网关";
    public static final String deviceType = "IOT-VCP-0002";
    public static final String defDeviceId = WaterQualityApplication.getApplication().getDevicesId();

    //订阅 topic
    public static final String DataImageSubscribeTopic = defDeviceId + "/DataImage_Reply";
    public static final String DataSubscribeTopic = defDeviceId + "/Data_Reply";
    public static final String UpgradeSubscribeTopic = defDeviceId + "/Upgrade";
    public static final String RelaySubscribeTopic = defDeviceId + "/Relay";
    public static final String IoSubscribeTopic = defDeviceId + "/Io";
    public static final String IoStateChangesSubscribeTopic = defDeviceId + "I/oStateChanges_Reply";

    //发布 topic
    public static final String DataImagePublishTopic = defDeviceId + "/DataImage";
    public static final String DataPublishTopic = defDeviceId + "/Data";
    public static final String UpgradePublishTopic = defDeviceId + "/Upgrade_Reply";
    public static final String RelayPublishTopic = defDeviceId + "/Relay_Reply";
    public static final String IoPublishTopic = defDeviceId + "/Io_Reply";
    public static final String IoStateChangesPublishTopic = defDeviceId + "/IoStateChanges";

    public static final String PREF = "pref";
    public static final String imageSet = "imageSet";

    public static final String ORPAvg = "ORPAvg";
    public static final String PHAvg = "PHAvg";
    public static final String VCPAvg = "VCPAvg";

    public static final String warningValue = "warning_value";

    //rtsp
    public static final String rtspIp = "rtspIp";
    public static final String rtspPort = "rtspPort";
    public static final String rtspUser = "rtspUser";
    public static final String rtspPassword = "rtspPassword";
    public static final String rtspDefIp = "192.168.1.64";
    public static final String rtspDefPort = "8000";
    public static final String rtspDefUser = "admin";
    public static final String rtspDefPassword = "BESTOM888";
    @SuppressLint("SdCardPath")
    public static final String warningImageDir = "/mnt/sdcard/Pictures/Warning/";
    @SuppressLint("SdCardPath")
    public static final String realImageDir = "/mnt/sdcard/Pictures/Real/";

    public static final String  themeSP1 = "theme1";
    public static final String ipMtSP1 = "ipMt1";
    public static final String portSP1 = "port1";
    public static final String mtDeviceIdSP1 = "mtDeviceId1";
    public static final String mtUserSP1 = "mtUser1";
    public static final String mtPasswordSP1 = "mtPassword1";
    public static final String periodSPSP1 = "period1";

    public static final String themeSP2 = "theme2";
    public static final String ipMtSP2 = "ipMt2";
    public static final String portSP2 = "port2";
    public static final String mtDeviceIdSP2 = "mtDeviceId2";
    public static final String mtUserSP2 = "mtUser2";
    public static final String mtPasswordSP2 = "mtPassword2";
    public static final String periodSPSP2 = "period2";

    public static final String defTheme = defDeviceId + "/Data";
    public static final String defIpMt = "218.108.204.218";
    public static final String defPort = "10002";
//    public static final String defIpMt = "192.168.1.5";
//    public static final String defPort = "1883";
    public static final String defUser = "admin";
    public static final String defPassword = "123456";
    public static final String defPeriod = "30";

    /**gp io 节点*/
    public static final String CAT_GP120  = "cat /sys/class/gpio/gpio120/value";
    public static final String OPEN_GP120  = "echo 1 > /sys/class/gpio/gpio120/value";
    public static final String CLOSE_GP120 = "echo 0 > /sys/class/gpio/gpio120/value";

    public static final String CAT_GP121 = "cat /sys/class/gpio/gpio121/value";
    public static final String OPEN_GP121 = "echo 1 > /sys/class/gpio/gpio121/value";
    public static final String CLOSE_GP121 = "echo 0 > /sys/class/gpio/gpio121/value";

    public static final String CAT_GP122  = "cat /sys/class/gpio/gpio122/value";
    public static final String OPEN_GP122  = "echo 1 > /sys/class/gpio/gpio122/value";
    public static final String CLOSE_GP122 = "echo 0 > /sys/class/gpio/gpio122/value";

    public static final String CAT_GP123  = "cat /sys/class/gpio/gpio123/value";
    public static final String OPEN_GP123  = "echo 1 > /sys/class/gpio/gpio123/value";
    public static final String CLOSE_GP123 = "echo 0 > /sys/class/gpio/gpio123/value";

    public static final String CAT_GP15  = "cat /sys/class/gpio/gpio15/value";
    public static final String OPEN_GP15  = "echo 1 > /sys/class/gpio/gpio15/value";
    public static final String CLOSE_GP15 = "echo 0 > /sys/class/gpio/gpio15/value";

    public static final String CAT_GP17  = "cat /sys/class/gpio/gpio17/value";
    public static final String OPEN_GP17  = "echo 1 > /sys/class/gpio/gpio17/value";
    public static final String CLOSE_GP17 = "echo 0 > /sys/class/gpio/gpio17/value";

    public static final String[] GROUP_NAMES = {"状态查看", "网络设置", "外设管理", "服务器配置", "管理", "应用管理"};
    public static final int[] GROUP_ICONS = {R.drawable.status, R.drawable.net_set, R.drawable.peripheral, R.drawable.service, R.drawable.manage, R.drawable.application_manage};
    public static final String[][] CHILD_NAMES = {
            {"设备状态", "外设状态", "预警记录", "图像查看"},
            {"配置网络"},
            {"串口设置", "继电器设置", "IO设置"},
            {"MQTT配置"},
            {"图像设置", "重新开机", "恢复出厂设置", "软件升级"},
            {"传感器设置", "RTSP设置"}
    };

    public static final int[][] CHILD_ICONS = {
            {R.drawable.device_status, R.drawable.peripheral_status, R.drawable.warning, R.drawable.image},
            {R.drawable.wlan},
            {R.drawable.serial, R.drawable.relay, R.drawable.io},
            {R.drawable.mqtt},
            {R.drawable.image_set, R.drawable.reboot, R.drawable.recover, R.drawable.update},
            {R.drawable.sensor, R.drawable.rtsp}
    };
    public static final int[][] CHILD_COLOR_ICONS = {
            {R.drawable.device_status_color, R.drawable.peripheral_status_color, R.drawable.warning_color, R.drawable.image_color},
            {R.drawable.wlan_color},
            {R.drawable.serial_color, R.drawable.relay_color, R.drawable.io_color},
            {R.drawable.mqtt_color},
            {R.drawable.image_set_color, R.drawable.reboot_color, R.drawable.recover_color, R.drawable.update_color},
            {R.drawable.sensor_color, R.drawable.rtsp_color}
    };
}
